<template>
	<view class="page" style="background-color:white;">

		<u-navbar :placeholder="true" bgColor="#ffffff">
			<view class="u-nav-slot topsearch" slot="left">
				<u-search placeholder="搜索你想要的功能" v-model="keyword" :animation="false" :showAction="false"
					@input="autoSearch()" :clearabled="false" :customActionStyle="customActionStyle" />
			</view>
			<view class="u-nav-slot" slot="right">
				<view class="searchbtn">
					搜索
				</view>
			</view>
		</u-navbar>
		<view class="tab">
			<scroll-view :scroll-x="true" class="scroll-X" :scroll-into-view="scrollTabId" :show-scrollbar='false'
				:scroll-with-animation="true">
				<view class="tab-item" v-for="(item,index) in tabList" :key="index"
					:class="{'tab-item-select':index==selectIndex}" :id="'tabId'+index" @click="changeTab(item,index)">
					<text>{{item.title}}</text>
					<view class="tab-item-line" v-if="index==selectIndex"></view>
				</view>
			</scroll-view>
		</view>
		<view class="context" v-if="!isSearching">
			<swiper class="swiper" :current="selectIndex" @change="changeSwiper">
				<swiper-item v-for="(item,index) in tabList" :key="index">
					<scroll-view scroll-y="true" class="scroll-Y-chunk" :show-scrollbar='false'>
						<view class="context-box-item">
							<view class="context-box-item-chunk" v-for="(item,indexs) in item.list" :key="indexs">
								<view class="context-box-item-chunk-image">
									<view class="context-box-item-chunk-image-shadow">
										<image style="width: 50rpx; height: 50rpx;" :src="item.image"></image>
									</view>
									<view class="collect">
										<!-- 根据 item.love 的值决定显示哪个图片 -->
										<image @click="toggleCollection(item,indexs)" v-if="item.loves == 1"
											:src="item.imagess"></image>
										<image @click="toggleCollection(item,indexs)" v-else :src="item.images"></image>
									</view>
								</view>
								<view @click="goPage(item,indexs)" class="context-box-item-chunk-title">{{item.title}}
								</view>
								<view @click="goPage(item,indexs)" class="context-box-item-chunk-text">{{item.content}}
								</view>
							</view>
						</view>
						<view v-if="index === 2 && loves == ''" class="bg">
							<image src="../../static/create/scs.png" mode="widthFix"></image>
							<view class="title">
								你还没有收藏记录
							</view>
						</view>
					</scroll-view>
				</swiper-item>
			</swiper>
		</view>
		<view class="context" v-else>
			<swiper class="swiper" :current="selectIndex" @change="changeSwiper">
				<!-- initial data list -->
				<swiper-item v-for="(item,index) in tabList" :key="index">
					<scroll-view scroll-y="true" class="scroll-Y-chunk" :show-scrollbar='false'>
						<!-- this section is the slice of fixed height -->
						<swiper-slide>
							<view class="context-box-item">
								<view class="context-box-item-chunk" v-for="(item, indexs) in filteredList1"
									:key="indexs" @click="goPage(item, indexs)">
									<view class="context-box-item-chunk-image">
										<view class="context-box-item-chunk-image-shadow">
											<image style="width: 50rpx; height: 50rpx;" :src="item.image"></image>
										</view>
									</view>
									<view class="context-box-item-chunk-title">{{item.title}}</view>
									<view class="context-box-item-chunk-text">{{item.content}}</view>
								</view>
							</view>
						</swiper-slide>
					</scroll-view>
				</swiper-item>
			</swiper>
		</view>
		<!-- 弹窗页面 -->
		<u-popup :show="statementShows" @click.stop="" mode="center" @close="close" :closeable="false"
			:closeOnClickOverlay="false" round="14">
			<view class="statementbox">
				<view class="statement">
					<image src="../../static/home/nosay.png" mode=""></image>
				</view>
				<view class="statemens">
					<image src="../../static/home/jyla.jpg" mode=""></image>
				</view>
				<view class="statementtext">
					你的账号存在违规,请联系客服解封
					如以解封，请删除重进，有五分钟缓冲时间
				</view>
				<view class="surebtnstyle">
					<view class="surebtn" @click="close">
						联系客服
					</view>
				</view>
			</view>
		</u-popup>
	</view>
</template>
<script>
	import {
		apiMixUrlApi
	} from "../../api/assemb";
	export default {
		data() {
			return {
				statusBarHeight: 20,
				/* 状态栏高度 */
				top: 0,
				navBarHeight: 45,
				/* 导航栏高度 */
				statementShows: false,
				searchBarTop: 0, //搜索栏的外边框高度，单位px
				searchBarHeight: 0, //搜索栏的高度，单位p
				keyword: '',
				selectIndex: 1,
				scrollTabId: 'tabId0',
				message: 'aa',
				// 自定义右侧控件样式
				customActionStyle: {
					background: '#F2F2F2',
					color: '#919191',
					fontSize: '27rpx'
				},
				tabList: [{
						title: '全部',
						type: 0,
						list: []
					},
					{
						title: '热门',
						type: 1,
						list: []
					},
					{
						title: '收藏',
						type: 9,
						love: 1,
						list: []
					},
					{
						title: '短视频',
						type: 2,
						list: []
					},
					{
						title: '教育(论文)',
						type: 3,
						list: []
					},
					{
						title: '电商',
						type: 4,
						list: []
					},
					{
						title: '营销广告',
						type: 5,
						list: []
					},
					{
						title: '网站',
						type: 6,
						list: []
					},
					{
						title: '文学',
						type: 7,
						list: []
					},
					{
						title: '媒体写作',
						type: 8,
						list: []
					},
				],
				aList: [], // 展示的数据
				filteredList1: [], // 新增
				loves: [],
				isSearching: false,
				contextList: [{
						type: 1,
						image: '/static/create/create_cz.jpg',
						images: '/static/create/sc.png',
						imagess: '/static/create/scc.png',
						loves: 0,
						title: '小说',
						content: '可以生成各种风格类型的小说',
						// url: 'https://www.peiyine.com/aixzzj/appletblue/#/pages/fiction/fiction',
						url: '/pages_aiTools/fiction/fiction',
						tab: 0
						// url: 'http://192.168.3.50/#/pages/fiction/fiction'
					},
					{
						tab: 0,
						type: 1,
						image: '/static/create/create_lw.jpg',
						images: '/static/create/sc.png',
						imagess: '/static/create/scc.png',
						loves: 0,
						title: '学生作文',
						content: '为中小学生题目提供优秀范文，帮助你学习',
						// url: 'https://www.peiyine.com/aixzzj/appletblue/#/pages/studentComposition/studentComposition'
						url: '/pages_aiTools/student/student',
					},
					{
						tab: 0,
						type: 1,
						image: '/static/create/create_lw.jpg',
						images: '/static/create/sc.png',
						imagess: '/static/create/scc.png',
						loves: 0,
						title: '论文',
						content: '为中小学生题目提供优秀范文',
						url: '/pages_aiTools/paper/paper',
						// url: 'https://www.peiyine.com/aixzzj/appletblue/#/pages/paper/paper'
					},
					{
						tab: 0,
						type: 1,
						image: '/static/create/create_dsp.png',
						images: '/static/create/sc.png',
						imagess: '/static/create/scc.png',
						loves: 0,
						title: '短视频',
						content: '生成vlog、口播稿等短视频的拍摄大纲',
						url: '/pages_aiTools/video/video',
						// url: 'https://www.peiyine.com/aixzzj/appletblue/#/pages/video/video'
					},
					{
						tab: 0,
						type: 1,
						image: '/static/create/create_cz.jpg',
						images: '/static/create/sc.png',
						imagess: '/static/create/scc.png',
						loves: 0,
						title: '影视解说',
						content: '生成各种解说文案',
						url: '/pages_aiTools/TVcom/TVcom',
						// url: 'https://www.peiyine.com/aixzzj/appletblue/#/pages/TVcompile/TVcompile'
					},
					{
						type: 1,
						image: '/static/create/create_cp.png',
						images: '/static/create/sc.png',
						imagess: '/static/create/scc.png',
						loves: 0,
						title: '教案计划',
						content: '生成合适的教学文案',
						url: 'https://www.peiyine.com/aixzzj/appletblue/#/pages/teachingPlan/teachingPlan/'
					},
					{
						tab: 0,
						type: 1,
						image: '/static/create/create_cz.jpg',
						images: '/static/create/sc.png',
						imagess: '/static/create/scc.png',
						loves: 0,
						title: '诗歌情诗',
						content: '一键生成各种类型的精美诗词',
						// url: 'https://www.peiyine.com/aixzzj/appletblue/#/pages/lovePoems/lovePoems',
						url: '/pages_aiTools/lovePoems/lovePoems',
					},

					{
						tab: 0,
						type: 1,
						image: '/static/create/create_cp.png',
						images: '/static/create/sc.png',
						imagess: '/static/create/scc.png',
						loves: 0,
						title: '新媒体全文写作',
						content: '一键生成新媒体文章（大约30秒）',
						// url: 'https://www.peiyine.com/aixzzj/appletblue/#/pages/newMedia/newMedia',
						url: '/pages_aiTools/newtool/newtool',
					},
					{
						type: 1,
						image: '/static/create/create_eso.png',
						images: '/static/create/sc.png',
						imagess: '/static/create/scc.png',
						loves: 0,
						title: '网站',
						content: '生成针对各种网站的内容以及文案',
						url: 'https://www.peiyine.com/aixzzj/appletblue/#/pages/Web/Web'
					},
					{
						type: 1,
						image: '/static/create/create_cp.png',
						images: '/static/create/sc.png',
						imagess: '/static/create/scc.png',
						loves: 0,
						title: '广告',
						content: '生成针对各种广告的内容以及文案',
						url: 'https://www.peiyine.com/aixzzj/appletblue/#/pages/advertising/advertising'
					},
					{
						type: 1,
						image: '/static/create/create_taobao.png',
						images: '/static/create/sc.png',
						imagess: '/static/create/scc.png',
						loves: 0,
						title: '好评文案',
						content: '生成针对各种广告的内容以及文案',
						url: 'https://www.peiyine.com/aixzzj/appletblue/#/pages/reputation/reputation'
					},
					{
						type: 1,
						image: '/static/create/create_dy.png',
						images: '/static/create/sc.png',
						imagess: '/static/create/scc.png',
						loves: 0,
						title: '大厨私房菜',
						content: '一键生成各菜系菜单，帮你找到你想要的',
						url: 'https://www.peiyine.com/aixzzj/appletblue/#/pages/kitchen/kitchen'
					},
					{
						type: 1,
						image: '/static/create/create_cz.jpg',
						images: '/static/create/sc.png',
						imagess: '/static/create/scc.png',
						loves: 0,
						title: '梦境分析',
						content: '为你的梦境进行详细分解，帮你排忧解难',
						url: 'https://www.peiyine.com/aixzzj/appletblue/#/pages/dream/dream'
					},
					{
						type: 1,
						image: '/static/create/create_lw.jpg',
						images: '/static/create/sc.png',
						imagess: '/static/create/scc.png',
						loves: 0,
						title: '概括总结',
						content: '为你生成各个场景下的总结',
						url: 'https://www.peiyine.com/aixzzj/appletblue/#/pages/summarize/summarize'
					},
					{
						type: 1,
						image: '/static/create/create_lw.jpg',
						images: '/static/create/sc.png',
						imagess: '/static/create/scc.png',
						loves: 0,
						title: '发言稿',
						content: '为你编撰演讲稿，流利通顺，消除紧张',
						url: 'https://www.peiyine.com/aixzzj/appletblue/#/pages/statement/statement'
					},
					{
						type: 2,
						image: '/static/create/create_xz.png',
						images: '/static/create/sc.png',
						imagess: '/static/create/scc.png',
						loves: 0,
						title: '全文写作',
						content: '按照写作步骤一步步生成文章',
						url: 'https://www.peiyine.com/aixzzj/appletblue/#/pages/fullText/fullText'
					},

					{
						type: 2,
						image: '/static/create/create_dsp.png',
						images: '/static/create/sc.png',
						imagess: '/static/create/scc.png',
						loves: 0,
						title: '万能翻译',
						content: '一键式多语言翻译，助你方便快捷',
						url: 'https://www.peiyine.com/aixzzj/appletblue/#/pages/translate/translate'
					},

					{
						type: 5,
						image: '/static/create/create_taobao.png',
						images: '/static/create/sc.png',
						imagess: '/static/create/scc.png',
						loves: 0,
						title: '电商',
						content: '根据产品特点生成各种内容，优化等',
						url: 'https://www.peiyine.com/aixzzj/appletblue/#/pages/e-commerce/e-commerce'
					},
					{
						type: 5,
						image: '/static/create/create_cp.png',
						images: '/static/create/sc.png',
						imagess: '/static/create/scc.png',
						loves: 0,
						title: '合同模板',
						content: '生成各种合同模板，随意使用',
						url: 'https://www.peiyine.com/aixzzj/appletblue/#/pages/contract/contract'
					},
					{
						type: 5,
						image: '/static/create/create_taobao.png',
						images: '/static/create/sc.png',
						imagess: '/static/create/scc.png',
						loves: 0,
						title: '产品特性描述',
						content: '生成一条多角度描述产品特色的文案',
						url: 'https://www.peiyine.com/aixzzj/appletblue/#/pages/productDescribe/productDescribe'

					},
					{
						type: 2,
						image: '/static/create/create_xhs.png',
						images: '/static/create/sc.png',
						imagess: '/static/create/scc.png',
						loves: 0,
						title: '小红书笔记标题',
						content: '为你的小红书笔记生成充满点击欲的标题',
						url: 'https://www.peiyine.com/aixzzj/appletblue/#/pages/redBook/redBook'

					},
					{
						type: 2,
						image: '/static/create/create_dsp.png',
						images: '/static/create/sc.png',
						imagess: '/static/create/scc.png',
						loves: 0,
						title: '短视频带货文案',
						content: '一键生成带货金句，让你的商品不愁买家',
						url: 'https://www.peiyine.com/aixzzj/appletblue/#/pages/shortVideo/shortVideo'
					},
					{
						type: 2,
						image: '/static/create/create_wx.png',
						images: '/static/create/sc.png',
						imagess: '/static/create/scc.png',
						loves: 0,
						title: '文章主题及大纲',
						content: '为你提供文章主题的新灵感 并为其创建推文提纲',
						url: 'https://www.peiyine.com/aixzzj/appletblue/#/pages/articleOutline/articleOutline'

					},
					{
						type: 7,
						image: '/static/create/create_eso.png',
						images: '/static/create/sc.png',
						imagess: '/static/create/scc.png',
						loves: 0,
						title: '网站首页SEO优化',
						content: '为文章标题和简述进行SEO优化',
						url: 'https://www.peiyine.com/aixzzj/appletblue/#/pages/webSEO/webSEO'
					},
					{
						type: 5,
						image: '/static/create/create_cp.png',
						images: '/static/create/sc.png',
						imagess: '/static/create/scc.png',
						loves: 0,
						title: '产品简介',
						content: '生成让人想下单的产品介绍文案',
						url: 'https://www.peiyine.com/aixzzj/appletblue/#/pages/introduceProduct/introduceProduct'
					},
					{
						type: 3,
						image: '/static/create/create_dy.png',
						images: '/static/create/sc.png',
						imagess: '/static/create/scc.png',
						loves: 0,
						title: '抖音带货标题',
						content: '一键生成带货标题，省时省力',
						url: 'https://www.peiyine.com/aixzzj/appletblue/#/pages/dySell/dySell'
					},

					{
						type: 1,
						image: '/static/create/create_zh.jpg',
						images: '/static/create/sc.png',
						imagess: '/static/create/scc.png',
						loves: 0,
						title: '知乎问答',
						content: '生成一些能够引起热烈讨论的好问题',
						url: 'https://www.peiyine.com/aixzzj/appletblue/#/pages/zhihuAnswer/zhihu'
					},

					{
						type: 2,
						type2: 1,
						image: '/static/create/create_xmt.png',
						images: '/static/create/sc.png',
						imagess: '/static/create/scc.png',
						loves: 0,
						title: '新媒体文章标题',
						content: '根据输入的关键词生成引人入胜的文章标题',
						url: 'https://www.peiyine.com/aixzzj/appletblue/#/pages/newMediaTitle/newMediaTitle'
					},

					{
						type: 4,
						image: '/static/create/create_cz.jpg',
						images: '/static/create/sc.png',
						imagess: '/static/create/scc.png',
						loves: 0,
						title: '学科出题',
						content: '一键生成各个学科题目，快捷方便',
						url: 'https://www.peiyine.com/aixzzj/appletblue/#/pages/SubjectIssue/SubjectIssue'
					},
					{
						type: 4,
						image: '/static/create/create_cz.jpg',
						images: '/static/create/sc.png',
						imagess: '/static/create/scc.png',
						loves: 0,
						title: '学习计划',
						content: '针对各阶段学科生成学习计划',
						url: 'https://www.peiyine.com/aixzzj/appletblue/#/pages/studyPlan/studyPlan'
					},
					{
						type: 4,
						image: '/static/create/create_lw.jpg',
						images: '/static/create/sc.png',
						imagess: '/static/create/scc.png',
						loves: 0,
						title: '考研题目',
						content: '针对考验生成各个学科的题目',
						url: 'https://www.peiyine.com/aixzzj/appletblue/#/pages/ordeal/ordeal'
					},
					{
						type: 4,
						image: '/static/create/create_xmt.png',
						images: '/static/create/sc.png',
						imagess: '/static/create/scc.png',
						loves: 0,
						title: '文章主题及大纲',
						content: '为你提供文章主题的新灵感并为其创建推文提纲',
						url: 'https://www.peiyine.com/aixzzj/appletblue/#/pages/articleOutline/articleOutline'
					},
					{
						type: 1,
						image: '/static/create/create_xmt.png',
						images: '/static/create/sc.png',
						imagess: '/static/create/scc.png',
						loves: 0,
						title: '回复老板',
						content: '一键生成各种场景下回复老板文案',
						url: 'https://www.peiyine.com/aixzzj/appletblue/#/pages/Boss/Boss'
					},
					{
						type: 1,
						image: '/static/create/create_xmt.png',
						images: '/static/create/sc.png',
						imagess: '/static/create/scc.png',
						loves: 0,
						title: '日报/周报/月报',
						content: '根据工作内容生成日报，周报，月报',
						url: 'https://www.peiyine.com/aixzzj/appletblue/#/pages/reports/reports'
					},
					{
						type: 2,
						image: '/static/create/create_xhs.png',
						images: '/static/create/sc.png',
						imagess: '/static/create/scc.png',
						loves: 0,
						title: '小红书种草文案',
						content: '帮你生成复合小红书调性的分享文案',
						url: 'https://www.peiyine.com/aixzzj/appletblue/#/pages/redBookWriting/redBookWriting'
					},
					{
						type: 1,
						image: '/static/create/create_xhs.png',
						images: '/static/create/sc.png',
						imagess: '/static/create/scc.png',
						loves: 0,
						title: '小红书旅游攻略',
						content: '根据目的地和旅游天数生成旅游的攻略',
						url: 'https://www.peiyine.com/aixzzj/appletblue/#/pages/reedBooktravel/reedBooktravel'
					},
					{
						type: 2,
						image: '/static/create/create_cz.jpg',
						images: '/static/create/sc.png',
						imagess: '/static/create/scc.png',
						loves: 0,
						title: '邮件撰写',
						content: '一键撰写各种类型邮件，帮你快速写邮件',
						url: 'https://www.peiyine.com/aixzzj/appletblue/#/pages/Email/Email'
					},
					{
						type: 2,
						image: '/static/create/create_cz.jpg',
						images: '/static/create/sc.png',
						imagess: '/static/create/scc.png',
						loves: 0,
						title: 'SWOT分析法',
						content: '基于内外部竞争环境和竞争条件下的态势分析',
						url: 'https://www.peiyine.com/aixzzj/appletblue/#/pages/SWOT/SWOT'
					},
					{
						type: 2,
						image: '/static/create/create_wx.png',
						images: '/static/create/sc.png',
						imagess: '/static/create/scc.png',
						loves: 0,
						title: '文章开头段',
						content: '一键生成新媒体文章的开头段',
						url: 'https://www.peiyine.com/aixzzj/appletblue/#/pages/ArticleStart/ArticleStart'
					},

					{
						type: 4,
						image: '/static/create/create_lw.png',
						images: '/static/create/sc.png',
						imagess: '/static/create/scc.png',
						loves: 0,
						title: '论文大纲',
						content: '根据论文题目和关键词生成论文大纲',
						url: 'https://www.peiyine.com/aixzzj/appletblue/#/pages/paperOutline/paperOutline'
					},
					{
						type: 4,
						image: '/static/create/create_lw.png',
						images: '/static/create/sc.png',
						imagess: '/static/create/scc.png',
						loves: 0,
						title: '论文摘要',
						content: '根据论文题目和关键词生成论文摘要',
						url: 'https://www.peiyine.com/aixzzj/appletblue/#/pages/paperAbstract/paperAbstract'
					},
					{
						type: 4,
						image: '/static/create/create_lw.png',
						images: '/static/create/sc.png',
						imagess: '/static/create/scc.png',
						loves: 0,
						title: '论文标题',
						content: '根据关键词生成论文标题，帮你解决难题',
						url: 'https://www.peiyine.com/aixzzj/appletblue/#/pages/paperArtical/paperArtical'
					},
					{
						type: 2,
						image: '/static/create/create_wx.png',
						images: '/static/create/sc.png',
						imagess: '/static/create/scc.png',
						loves: 0,
						title: '文章SEO优化',
						content: '对文章标题和简述进行SEO优化',
						url: 'https://www.peiyine.com/aixzzj/appletblue/#/pages/articleSEO/articleSEO'
					},
					{
						type: 3,
						image: '/static/create/create_dy.png',
						images: '/static/create/sc.png',
						imagess: '/static/create/scc.png',
						loves: 0,
						title: '带货视频口播稿',
						content: '带货视频口播稿，帮你解决话术难题',
						url: 'https://www.peiyine.com/aixzzj/appletblue/#/pages/dyOralDraft/dyOralDraft'
					},
					{
						type: 2,
						image: '/static/create/create_wx.png',
						images: '/static/create/sc.png',
						imagess: '/static/create/scc.png',
						loves: 0,
						title: '文章章节内容',
						content: '讲一个主题句扩写成媒体文章段落',
						url: 'https://www.peiyine.com/aixzzj/appletblue/#/pages/articleChapter/articleChapter'
					},
					{
						type: 3,
						image: '/static/create/create_dy.png',
						images: '/static/create/sc.png',
						imagess: '/static/create/scc.png',
						loves: 0,
						title: '视频灵感',
						content: '蹭点热点拍视频？让我们来提供灵感',
						url: 'https://www.peiyine.com/aixzzj/appletblue/#/pages/dyInspiration/dyInspiration'
					},
					{
						type: 1,
						image: '/static/create/create_zh.jpg',
						images: '/static/create/sc.png',
						imagess: '/static/create/scc.png',
						loves: 0,
						title: '知乎问题',
						content: '对知乎的问题进行深度解答',
						url: 'https://www.peiyine.com/aixzzj/appletblue/#/pages/zhihuQuestion/zhihu'
					},
					{
						type: 1,
						image: '/static/create/create_xz.png',
						images: '/static/create/sc.png',
						imagess: '/static/create/scc.png',
						loves: 0,
						title: '营销文案-戳痛点',
						content: '戳中用户痛点，打造爆款产品',
						url: 'https://www.peiyine.com/aixzzj/appletblue/#/pages/marketing/marketing'
					},
					{
						type: 3,
						image: '/static/create/create_dy.png',
						images: '/static/create/sc.png',
						imagess: '/static/create/scc.png',
						loves: 0,
						title: '视频吸睛开头',
						content: '用视频的开头黄金5秒，锁定观众的注意力',
						url: 'https://www.peiyine.com/aixzzj/appletblue/#/pages/dyAction/dyAction'
					},
					{
						type: 3,
						image: '/static/create/create_dy.png',
						images: '/static/create/sc.png',
						imagess: '/static/create/scc.png',
						loves: 0,
						title: '视频标题',
						content: '快速帮你打造有吸引力的视频标题',
						url: 'https://www.peiyine.com/aixzzj/appletblue/#/pages/dyTitle/dyTitle'
					},
					{
						type: 6,
						image: '/static/create/create_xz.png',
						images: '/static/create/sc.png',
						imagess: '/static/create/scc.png',
						loves: 0,
						title: '营销文案-引导下单',
						content: '对文章标题和简述进行SEO优化',
						url: 'https://www.peiyine.com/aixzzj/appletblue/#/pages/marketingGuide/marketingGuide'
					},
					{
						type: 3,
						image: '/static/create/create_dy.png',
						images: '/static/create/sc.png',
						imagess: '/static/create/scc.png',
						loves: 0,
						title: '短视频脚本大纲',
						content: '生成vlog、口播稿等短视频的拍摄大纲',
						url: 'https://www.peiyine.com/aixzzj/appletblue/#/pages/dyScript/dyScript'
					},
					{
						type: 3,
						image: '/static/create/create_dy.png',
						images: '/static/create/sc.png',
						imagess: '/static/create/scc.png',
						loves: 0,
						title: '视频介绍',
						content: '对文章标题和简述进行SEO优化',
						url: 'https://www.peiyine.com/aixzzj/appletblue/#/pages/dyIntroduce/dyIntroduce'
					},
					{
						type: 6,
						image: '/static/create/create_dy.png',
						images: '/static/create/sc.png',
						imagess: '/static/create/scc.png',
						loves: 0,
						title: '“离婚式”广告',
						content: '离婚式广告,接头文案的神,跟紧时代',
						url: 'https://www.peiyine.com/aixzzj/appletblue/#/pages/adDivorce/adDivorce'
					},
					{
						type: 5,
						image: '/static/create/create_taobao.png',
						images: '/static/create/sc.png',
						imagess: '/static/create/scc.png',
						loves: 0,
						title: '产品卖点罗列',
						content: '提炼差异化，让你的产品脱颖而出',
						url: 'https://www.peiyine.com/aixzzj/appletblue/#/pages/productSelling/productSelling'
					},
					{
						type: 3,
						image: '/static/create/create_dy.png',
						images: '/static/create/sc.png',
						imagess: '/static/create/scc.png',
						loves: 0,
						title: '短视频分镜灵感',
						content: '对文章标题和简述进行SEO优化',
						url: 'https://www.peiyine.com/aixzzj/appletblue/#/pages/dyStoryboard/dyStoryboard'
					},
					{
						type: 5,
						image: '/static/create/create_taobao.png',
						images: '/static/create/sc.png',
						imagess: '/static/create/scc.png',
						loves: 0,
						title: '商品优质好评',
						content: '根据产品特点为你生成超像真人写的好评',
						url: 'https://www.peiyine.com/aixzzj/appletblue/#/pages/Productreputation/Productreputation'
					},

					{
						type: 6,
						image: '/static/create/create_xz.png',
						images: '/static/create/sc.png',
						imagess: '/static/create/scc.png',
						loves: 0,
						title: 'Slogan广告语',
						content: '为企业、产品、网站生成Slogan',
						url: 'https://www.peiyine.com/aixzzj/appletblue/#/pages/adSlogan/adSlogan'
					},
					{
						type: 6,
						image: '/static/create/create_bd.jpg',
						images: '/static/create/sc.png',
						imagess: '/static/create/scc.png',
						loves: 0,
						title: '广告描述',
						content: '生成一条拥有精准洞察的广告标语',
						url: 'https://www.peiyine.com/aixzzj/appletblue/#/pages/adDescribe/adDescribe'
					},
					{
						type: 6,
						image: '/static/create/create_bd.jpg',
						images: '/static/create/sc.png',
						imagess: '/static/create/scc.png',
						loves: 0,
						title: '广告标语',
						content: '为网站生成元描述，激发用户了解欲',
						url: 'https://www.peiyine.com/aixzzj/appletblue/#/pages/adSlogan2/adSlogan2'
					},
					{
						type: 6,
						image: '/static/create/create_fb.jpg',
						images: '/static/create/sc.png',
						imagess: '/static/create/scc.png',
						loves: 0,
						title: 'facebook广告标题',
						content: '为你的Facebook广告创造“标题”',
						url: 'https://www.peiyine.com/aixzzj/appletblue/#/pages/facebookTitle/facebookTitle'
					},
					{
						type: 6,
						image: '/static/create/create_fb.jpg',
						images: '/static/create/sc.png',
						imagess: '/static/create/scc.png',
						loves: 0,
						title: 'facebook广告描述',
						content: '为你的Facebook广告生成完美的主要内容',
						url: 'https://www.peiyine.com/aixzzj/appletblue/#/pages/facebookDescribe/facebookDescribe'
					},
					{
						type: 7,
						image: '/static/create/create_web.jpg',
						images: '/static/create/sc.png',
						imagess: '/static/create/scc.png',
						loves: 0,
						title: '网页大标题',
						content: '为你的网站创建高点击率的大标题',
						url: 'https://www.peiyine.com/aixzzj/appletblue/#/pages/WebTitle/WebTitle'
					},
					{
						type: 7,
						image: '/static/create/create_web.jpg',
						images: '/static/create/sc.png',
						imagess: '/static/create/scc.png',
						loves: 0,
						title: '公司背景',
						content: '创作一段能引起共鸣的公司背景介绍',
						url: 'https://www.peiyine.com/aixzzj/appletblue/#/pages/company/company'
					},
					{
						type: 7,
						image: '/static/create/create_web.jpg',
						images: '/static/create/sc.png',
						imagess: '/static/create/scc.png',
						loves: 0,
						title: '产品核心价值',
						content: '一句话阐明产品的核心价值，帮你刨析全面',
						url: 'https://www.peiyine.com/aixzzj/appletblue/#/pages/companyKernel/companyKernel'
					},
					{
						type: 7,
						image: '/static/create/create_web.jpg',
						images: '/static/create/sc.png',
						imagess: '/static/create/scc.png',
						loves: 0,
						title: '产品核心要点',
						content: '耐克篮球鞋与新一代气垫，帮你全面刨析',
						url: 'https://www.peiyine.com/aixzzj/appletblue/#/pages/companyCore/companyCore'
					},
					{
						type: 7,
						image: '/static/create/create_web.jpg',
						images: '/static/create/sc.png',
						imagess: '/static/create/scc.png',
						loves: 0,
						title: '创意故事',
						content: '帮你续写创意故事，井井有条',
						url: 'https://www.peiyine.com/aixzzj/appletblue/#/pages/storage/storage'
					},
					{
						type: 8,
						image: '/static/create/create_xz.png',
						images: '/static/create/sc.png',
						imagess: '/static/create/scc.png',
						loves: 0,
						title: '人物塑造',
						content: '帮你续写创意故事，分析人物性格',
						url: 'https://www.peiyine.com/aixzzj/appletblue/#/pages/characterization/characterization'
					},
					{
						type: 7,
						image: '/static/create/create_web.jpg',
						images: '/static/create/sc.png',
						imagess: '/static/create/scc.png',
						loves: 0,
						title: '公司或产品起名',
						content: '提供源源不断的起名灵感，帮你节省时间',
						url: 'https://www.peiyine.com/aixzzj/appletblue/#/pages/webNaming/webNaming'
					},
					{
						type: 4,
						image: '/static/create/create_lw.jpg',
						images: '/static/create/sc.png',
						imagess: '/static/create/scc.png',
						loves: 0,
						title: '雅思大作文',
						content: '根据题目生成雅思写作题答案，学习经典',
						url: 'https://www.peiyine.com/aixzzj/appletblue/#/pages/IELTS/IELTS'
					},
					{
						type: 4,
						image: '/static/create/create_lw.jpg',
						images: '/static/create/sc.png',
						imagess: '/static/create/scc.png',
						loves: 0,
						title: '学生会活动策划',
						content: '根据主题生成学生会活动策划案，助你一臂之力',
						url: 'https://www.peiyine.com/aixzzj/appletblue/#/pages/studentPlanning/studentPlanning'
					},

					{
						type: 8,
						image: '/static/create/create_xz.png',
						images: '/static/create/sc.png',
						imagess: '/static/create/scc.png',
						loves: 0,
						title: '赛博朋克鬼故事',
						content: '夏天听个鬼故事冷静冷静，你害怕吗',
						url: 'https://www.peiyine.com/aixzzj/appletblue/#/pages/ghostStories/ghostStories'
					},
					{
						type: 8,
						image: '/static/create/create_xz.png',
						images: '/static/create/sc.png',
						imagess: '/static/create/scc.png',
						loves: 0,
						title: '疯狂星期四',
						content: 'V-ME-50,瞧瞧实力？一起疯狂起来吧',
						url: 'https://www.peiyine.com/aixzzj/appletblue/#/pages/crazyThursday/crazyThursday'
					},
					{
						type: 8,
						image: '/static/create/create_cz.jpg',
						images: '/static/create/sc.png',
						imagess: '/static/create/scc.png',
						loves: 0,
						title: '对联',
						content: '替你写一幅对仗工整的对联',
						url: 'https://www.peiyine.com/aixzzj/appletblue/#/pages/couplet/couplet'
					},
					{
						type: 8,
						image: '/static/create/create_cz.jpg',
						images: '/static/create/sc.png',
						imagess: '/static/create/scc.png',
						loves: 0,
						title: '散文',
						content: '为你写一篇文辞优美的散文',
						url: 'https://www.peiyine.com/aixzzj/appletblue/#/pages/prose/prose'
					},
					{
						type: 8,
						image: '/static/create/create_cz.jpg',
						images: '/static/create/sc.png',
						imagess: '/static/create/scc.png',
						loves: 0,
						title: '现代诗',
						content: '根据关键词写一首现代诗',
						url: 'https://www.peiyine.com/aixzzj/appletblue/#/pages/modernVerse/modernVerse'
					},
					{
						type: 8,
						image: '/static/create/create_cz.jpg',
						images: '/static/create/sc.png',
						imagess: '/static/create/scc.png',
						loves: 0,
						title: '废话文学生成器',
						content: '需要一些废话，有用的“废话”才不是护眼乱语',
						url: 'https://www.peiyine.com/aixzzj/appletblue/#/pages/nonsense/nonsense'
					},
					{
						type: 1,
						image: '/static/create/create_xhs.png',
						images: '/static/create/sc.png',
						imagess: '/static/create/scc.png',
						loves: 0,
						title: '餐馆探店文案',
						content: '进行一场开开心心的探店之旅吧',
						url: 'https://www.peiyine.com/aixzzj/appletblue/#/pages/redbookRestaurant/redbookRestaurant'
					},
					{
						type: 1,
						image: '/static/create/create_xhs.png',
						images: '/static/create/sc.png',
						imagess: '/static/create/scc.png',
						loves: 0,
						title: '景点打卡文案',
						content: '输入城市或景点的名称，便可得到一篇打卡文案',
						url: 'https://www.peiyine.com/aixzzj/appletblue/#/pages/redbookScenic/redbookScenic'
					},

					{
						type: 1,
						image: '/static/create/create_lw.jpg',
						images: '/static/create/sc.png',
						imagess: '/static/create/scc.png',
						loves: 0,
						title: '日程计划',
						content: '为你制定完美计划，安排头头是道',
						url: 'https://www.peiyine.com/aixzzj/appletblue/#/pages/schedulePlanning/schedulePlanning'
					},
					{
						type: 1,
						image: '/static/create/create_xz.png',
						images: '/static/create/sc.png',
						imagess: '/static/create/scc.png',
						loves: 0,
						title: '"泰裤辣"',
						content: '那我觉得这件事真的是泰裤辣！',
						url: 'https://www.peiyine.com/aixzzj/appletblue/#/pages/cool/cool'
					},
					{
						type: 1,
						image: '/static/create/create_xz.png',
						images: '/static/create/sc.png',
						imagess: '/static/create/scc.png',
						loves: 0,
						title: '社交app个性签名',
						content: '一键生成各种社交app的个性签名',
						url: 'https://www.peiyine.com/aixzzj/appletblue/#/pages/social/social'
					},
					{
						type: 1,
						image: '/static/create/create_xmt.png',
						images: '/static/create/sc.png',
						imagess: '/static/create/scc.png',
						loves: 0,
						title: '自定义输入',
						content: '当你不知道选那个模板,试试这个',
						url: 'https://www.peiyine.com/aixzzj/appletblue/#/pages/customInput/customInput'
					},
					{
						type: 1,
						image: '/static/create/create_xz.png',
						images: '/static/create/sc.png',
						imagess: '/static/create/scc.png',
						loves: 0,
						title: 'AI绘画描述词',
						content: '生成适用于AI绘画的描述词',
						url: 'https://www.peiyine.com/aixzzj/appletblue/#/pages/drawing/drawing'
					},

				],
			}
		},
		computed: {
			filteredList() {
				if (this.aList.length === 0) {
					return []
				} else {
					const reg = new RegExp(this.searchValue, 'i')
					return this.aList.filter(item => {
						return item.title.match(reg) || item.content.match(reg)
					})
				}
			}
		},

		onLoad() {
			if (uni.getStorageSync('ban')) {
				this.statementShows = true;
			} else {
				this.statementShows = false;
			}
			// console.log(uni.getStorageSync('ban'), '======================')
			// if (uni.getStorageSync('ban')) {
			// 	this.statementShows = true;
			// } else {
			// 	this.statementShows = false;
			// }
			//   console.log('onInit',this.tabList[1].List)
			let menuButtonInfo = uni.getMenuButtonBoundingClientRect();
			console.log(menuButtonInfo, '这是机型的大小')
			this.top = menuButtonInfo.top - 22
			let tops = this.top / 2
			console.log(tops, '对不对在这里说')
			console.log(this.top, '----------------------')
			this.searchBarTop = menuButtonInfo.top;
			this.searchBarHeight = menuButtonInfo.height;
			let that = this

			this.loves = uni.getStorageSync('loves') || []; // 从缓存中读取数据
			this.loves.forEach(item => {
				if (this.loves.includes(item)) { // 如果loves中包含当前item
					that.tabList[2].list.push(item);
				}
			});

			this.loves.forEach((loveItem, loveIndex) => {
				this.contextList.forEach((contextItem, contextIndex) => {
					if (contextItem.title === loveItem.title && loveItem.loves !== undefined && loveItem
						.loves !== null) {
						// 将 this.loves 中的 loves 字段赋值给 this.contextList 中对应的 loves 字段  
						this.contextList[contextIndex] = loveItem;
					}
				});
			});

			this.contextList.forEach(item => {
				switch (item.type) {
					case 1:
						that.tabList[1].list.push(item);
						break
					case 2:
						that.tabList[9].list.push(item);
						break
					case 3:
						that.tabList[3].list.push(item);
						break
					case 4:
						that.tabList[4].list.push(item);
						break
					case 5:
						that.tabList[5].list.push(item);
						break
					case 6:
						that.tabList[6].list.push(item);
						break
					case 7:
						that.tabList[7].list.push(item);
						break
					case 8:
						that.tabList[8].list.push(item);
						break
				}
			})
			this.tabList[0].list = this.contextList
			//   console.log("?? ~ file: create.vue:193 ~ onLoad ~ this.contextList:", this.contextList)

		},
		onShow() {
			console.log(uni.getStorageSync('ban'), '======================')
			if (uni.getStorageSync('ban')) {
				this.statementShows = true;
			} else {
				this.statementShows = false;
			}
			// 获取次数
			this.getFrequency();
		},
		methods: {
			// 获取次数
			getFrequency() {
				apiMixUrlApi({}, 1042, 'GetPaymentInfo').then(data => {
					if (data.descinfo == "success") {
						uni.setStorageSync('frequency', data.coins)
					}
				});
			},
			//点击跳转客服
			close() {
				uni.navigateTo({
					url: '/pages/service/service'
				})
			},
			//切换tab
			changeTab(item, index) {
				console.log(index,'000000')
				this.isSearching = false // 标记当前是否处于搜索状态
				console.log("?? ~ file: create.vue:197 ~ changeTab ~ item:", item, index)
				this.selectIndex = index
				let number = (index - 1) < 0 ? 0 : (index - 1)
				this.scrollTabId = 'tabId' + number
			},
			//切换swiper
			changeSwiper(e) {
				//   console.log("?? ~ file: create.vue:204 ~ changeSwiper ~ e:", e)
				this.selectIndex = e.detail.current
				let number = (e.detail.current - 1) < 0 ? 0 : (e.detail.current - 1)
				this.scrollTabId = 'tabId' + number
			},
			toggleCollection(item) {
				// 切换 item.loves 的状态  
				item.loves = (item.loves === 1) ? 0 : 1;

				if (item.loves === 1) {
					if (!this.loves.includes(item)) {
						this.tabList[2].list.push(item);
						this.loves.push(item);
						uni.setStorageSync('loves', this.loves);
					}
				} else {
					// 如果 item.loves 不为 1，从 this.tabList[2].list 中移除该项    
					const index = this.tabList[2].list.indexOf(item);
					const lovesIndex = this.loves.indexOf(item);
					if (lovesIndex !== -1) {
						this.loves.splice(lovesIndex, 1);
					}
					uni.setStorageSync('loves', this.loves); // 从缓存中移除该项    
					if (index !== -1) {
						this.tabList[2].list.splice(index, 1);
					}
				}
			},
			//跳转页面
			goPage(item) {
				console.log('item', item)
				console.log('item.url', item.url)
				// const id = 3
				if (item.tab == 0) {
					console.log('item.url', item.url)

					uni.navigateTo({
						url: item.url
					});
					console.log('11')
				} else {
					uni.navigateTo({
						url: '/pages/webview/webview?url=' + item.url
					});
					console.log('22')
				}
			},

			searchClick(value) {
				if (!value) { // 简化了值为空字符串和值为 null 和 undefined 的情况
					console.log('123')
					this.isSearching = false // 标记当前是否处于搜索状态
					// 如果输入的值为空则加载所有的列表
					// this.getList();
				} else {
					console.log('456')
					// 先清空展示的数据
					this.aList = []
					// 然后开始循环全部数据
					for (var i = 0; i < this.contextList.length; i++) {
						const item = this.contextList[i] // 将当前子项存储至一个变量中，避免频繁访问 this.contextList[i]
						// 判断数据里面是否有符合输入的内容
						//（核心所在，其它都是根据需求来自己写）
						if (item.title && item.title.indexOf(value) >= 0) { // 先判断该属性值是否存在再进行搜索
							this.aList.push(item)
							console.log('this.aList', this.aList)
						}
					}

					this.isSearching = true // 标记当前处于搜索状态
					this.filteredList1 = [...this.aList] // 将匹配值直接赋给 filteredList 数组，用于渲染
				}
				// 因为 aList 变量改变了，所以此处需要手动触发一次  的更新
				this.$forceUpdate() // 强制当前实例重新渲染，包括组件和子组件
			},



			toggleShowSearchResult() {
				this.showSearchResult = !this.showSearchResult
			},
			autoSearch: function() {
				this.searchClick(this.keyword)
			},
			// searchClick(value) {
			//   if (!value) {
			//     this.isSearching = false
			//     return;
			//   }
			//   this.filteredList1 = this.contextList.filter(item => item.title.indexOf(this.keyword) >=0 )
			//   this.isSearching = true
			// }

		}
	}
</script>
<style lang="less">
	.page {
		background: white;
	}

	.statementbox {
		width: 620rpx;
		// height: 572rpx;

		.statement {
			display: flex;
			justify-content: center;
			margin-top: 50rpx;

			image {
				width: 114rpx;
				height: 114rpx;
			}
		}

		.statemens {
			display: flex;
			justify-content: center;
			margin-top: 50rpx;

			image {
				width: 220rpx;
				height: 66rpx;
			}
		}

		.statementtext {
			// margin-left: 300rpx;
			font-size: 26rpx;
			margin-top: 60rpx;
			font-family: PingFang SC;
			font-weight: 500;
			color: #333333;
			margin: 0 115rpx;
			margin-top: 58rpx;
			margin-bottom: 48rpx;
		}

		.surebtnstyle {
			display: flex;
			justify-content: center;

			.surebtn {
				display: flex;
				justify-content: center;
				align-items: center;
				font-size: 34rpx;
				font-family: PingFang SC;
				font-weight: 500;
				color: #ffffff;
				width: 440rpx;
				height: 117rpx;
				background-repeat: no-repeat;
				background-size: cover;
				background-image: url("https://mysmallapp.oss-cn-shanghai.aliyuncs.com/aixz/img/xzybg.png");
			}
		}
	}

	.bg {
		margin-top: 30%;
		margin-left: 170rpx;
		width: 400rpx;
		height: 400rpx;

		image {
			width: 100%;
			height: 100%;
		}

		.title {
			font-size: 36rpx;
			font-family: PingFang SC;
			font-weight: 500;
			color: #9F9F9F;
			margin-top: 30rpx;
			margin-left: 68rpx;
			;
		}

		// background:#E7F4FD;
		// background-size: cover; /* 背景图填充整个视图 */
		// background-repeat: no-repeat;
	}

	.page {
		width: 100%;
		height: 100vh;
		background-color: #f7f7f7;
	}

	.tab {
		width: 100%;
		height: 100rpx;
		background-color: #fff;
		position: fixed;
		left: 0;
		z-index: 99;
		width: 100%;

		.scroll-X {
			width: 100%;
			height: 100%;
			white-space: nowrap;

			.tab-item {
				height: 100%;
				padding: 0rpx 40rpx;
				color: #8b8b8b;
				display: inline-block;
				line-height: 100rpx;
				position: relative;
				font-size: 30rpx;

				.tab-item-line {
					width: 30rpx;
					height: 6rpx;
					position: absolute;
					bottom: 14rpx;
					left: 50%;
					transform: translateX(-50%);
					background-color: #4bb591;
				}
			}

			.tab-item-select {
				color: #333333;
			}
		}
	}

	.context {
		width: 100%;
		height: calc(100vh - 100rpx);
		background-color: #f7f7f7;
		box-sizing: border-box;
		margin-top: 100rpx;

		.swiper {
			width: 100%;
			height: 100%;

			.scroll-Y-chunk {
				width: 100%;
				height: 100%;

				.context-box-item {
					width: 100%;
					display: flex;
					flex-wrap: wrap;
					justify-content: space-between;
					align-content: flex-start;
					box-sizing: border-box;
					padding: 30rpx 30rpx 10rpx;

					.context-box-item-chunk {
						width: 48%;
						height: 270rpx;
						background-color: #fff;
						margin-bottom: 30rpx;
						box-sizing: border-box;
						padding: 0 40rpx;
						box-shadow: 1px 1px 8px 2px #e4ecf1;

						.context-box-item-chunk-image {
							width: 100%;
							display: flex;
							align-items: center;
							margin-top: 30rpx;

							.context-box-item-chunk-image-shadow {
								padding: 6rpx;
								background-color: #f3efef;
								border-radius: 50%;
								display: flex;
								justify-content: center;
								align-items: center;
							}
						}

						.context-box-item-chunk-title {
							width: 100%;
							color: #333333;
							font-size: 28rpx;
							margin-top: 20rpx;
						}

						.context-box-item-chunk-text {
							width: 100%;
							font-size: 22rpx;
							color: #939393;
							margin-top: 20rpx;
							box-sizing: border-box;
						}
					}
				}
			}
		}
	}

	.search {
		// width: 100%;
		height: 200rpx;
		background-color: #fff;
		margin-top: 82rpx;
		padding-left: 20rpx;
		display: flex;
		justify-content: space-between;
		position: fixed;
		top: 0;
		left: 0;
		z-index: 99;
		width: 100%;

		// border: 2px solid red;
		.searchs {
			height: 44rpx;
			width: 108rpx;
			border: 1rpx solid #929292;
			border-radius: 25.8rpx;
			text-align: center;
			position: absolute;
			top: 11.3rpx;
			right: 250rpx;
			color: #333333;
		}
	}

	.search_bto {
		width: 100rpx;
		height: 60rpx;
		background-color: #00df66;
		margin: 0 40rpx 0;
		display: flex;
		align-items: center;
		justify-content: center;
		border-radius: 15rpx;
	}

	.search_text {
		color: #fff;
		line-height: 80rpx;
	}

	/deep/::-webkit-scrollbar {
		display: none;
		width: 0 !important;
		height: 0 !important;
		-webkit-appearance: none;
		background: transparent;
		color: transparent;
	}

	.topsearch {
		width: 512rpx;
	}

	.searchbtn {
		width: 99rpx;
		margin-right: 200rpx;
		height: 47rpx;
		background: #ffffff;
		border: 1px solid #333333;
		border-radius: 39rpx;
		display: flex;
		justify-content: center;
		align-items: center;
		font-size: 27rpx;
	}

	.collect {
		margin-left: 160rpx;

		image {
			width: 20px !important;
			height: 18px !important;
		}
	}
</style>